home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
music
/
550
/
fracsurf
/
fracsurf.doc
next >
Wrap
Text File
|
1991-08-13
|
4KB
|
105 lines
06601020202800
1* Fracsurf *
6L..T.T....T....T....T....T....T....T....T....T....T....T....T....R
àìFracSurf-TheFractalLandscapeGenerator
Ç
Thisprogramgeneratesrandomfractalsurfacesona128x128
facetgridandallowsyoutoviewthemfromanypointinspace.It
runsinlowresolution(320x200)orhighresolution(640x400)on
anyAtariST.
Operationoftheprogramisself-explanatory:Run
'FRACSURF.PRG'intheusualwayfromtheDesktopandit'll
immediatelygenerateanddisplaylandscape'0'('0'istheseed
fortherandomnumbergenerator).PressingSPACEwillthentoggle
betweentheviewofthelandscapeandthemenu:
f1-Newlandscape
Thisallowsyoutogenerateanewlandscape.Theprogramasks
youforan'f'valueandaseed.'f'definesthedegreeof
ruggednessofthelandscape,mostrealisticvaluesliebetween
about0.4and1.5.Greatervaluesthan1.5generatesurfacesmore
likemoonscapes.Theseedisameansofidentifyingthe
landscape.Eachvalueproducesatotallyuniquesurface,oneofmy
favouritesislandscape'12345'withan'f'valueof0.8.
Whilegeneratinganewsurface(whichtakesaboutaminute)the
pro-gramillustratesitsprogressbyfillingasquareonscreen,
eachpixelrepresentingafacetwhichhasbeencalculated.
Thetimetakentoshadeandplotthesurfacedependsonthe
detailsetting(definedbyf6).Thedefaultstartupvalueof4
meansthatthesurfaceisplottedasagridof32x32facets.
f2-Setviewpoint
Thisallowsyoutodefineyourviewpositioninthe3Duniverse
andyourviewingdirection.Enterfirstyourx,y,zcoordinatesand
thenthex,y,zcoordinatesofthepointonwhichyouwishthe
screentobecentred(usually0,0,0).Thesurfacelieswithinthe
limits-320and320inthexandydirections.
Inadditionyou'llbeaskedforamagnificationfactorforthe
view.Values>1giveatelephotoview,whilstvalues<1givea
wide-angleview.
f3-Setlightposition
Asfortheviewpositionthex,y,zcoordinatesofthesingle
lightsourceareentered.Thelightisactuallycalculatedas
beinginfinitelyfarawayinthedirectionofthispoint(ie.the
raysareparallel).
f4-Definesealevel(&snowlineinlores)
Thesealevel(&snowline)canbesettoanyheight,default
valuesbeing0and50,respectively.
f5-Savescreen(Degas)
Thissavesthecurrentviewasastandard,uncompressedDegas
file.
f6-Setdetail
Thedetailfactorforthedisplayofsurfacescanbeinthe
range0to6whichgivethefollowingsurfaceresolutions:
0-2x2facets
1-4x4
2-8x8
3-16x16
4-32x32
5-64x64
6-128x128
Plottingandshadingtimesgoupbyafactorof4witheach
increaseindetail.
f7-Landscapeinformation
Thisgivesinformationonthecurrentlandscapeandview.In
additionitcalculatesthe'fractaldimension'(D)ofthesurface,
whichforallfractalsurfacesliesbetween2and3(seeBenoit
Mandelbrot'sbook'TheFractalGeometryofNature').Highervalues
indicateamoreruggedlandscape,mostearthboundlandscapeslying
between2.3and2.4.Thereisprobablyamathematicalrelationship
between'f'and'D',althoughI'venoideawhatitis!
f10-Quit
That'sit.Ihopeyouhavefunexploringtheinfinityof
landscapesthatcanbegenerated.
Foranyonewho'sinterested,FRACSURF.PRGiswritteninGFA
Basic2andFastBasicassembler,andthecompletesourcecodeis
availablefromtheaddressbelowforthemodestfeeof£5.00.Any
comments/complaintsarealsowelcome!
JonathanMillar
StCatherine'sCollege
Oxford
OX13UJ